home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / SIOD 3.0 / siodp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-01  |  5.2 KB  |  193 lines  |  [TEXT/ttxt]

  1. /* Scheme In One Defun, but in C this time.
  2.  
  3.  *                        COPYRIGHT (c) 1988-1992 BY                        *
  4.  *        PARADIGM ASSOCIATES INCORPORATED, CAMBRIDGE, MASSACHUSETTS.       *
  5.  *        See the source file SLIB.C for more information.                  *
  6.  
  7. Declarations which are private to SLIB.C internals.
  8.  
  9. */
  10.  
  11.  
  12. extern char *tkbuffer;
  13. extern LISP heap,heap_end,heap_org;
  14. extern LISP truth;
  15.  
  16. struct user_type_hooks
  17. {LISP (*gc_relocate)(LISP);
  18.  void (*gc_scan)(LISP);
  19.  LISP (*gc_mark)(LISP);
  20.  void (*gc_free)(LISP);
  21.  void (*prin1)(LISP, FILE *);
  22.  LISP (*leval)(LISP, LISP *, LISP *);
  23.  long (*c_sxhash)(LISP,long);
  24.  LISP (*fast_print)(LISP,LISP);
  25.  LISP (*fast_read)(int,LISP);
  26.  LISP (*equal)(LISP,LISP);};
  27.  
  28. struct catch_frame
  29. {LISP tag;
  30.  LISP retval;
  31.  jmp_buf cframe;
  32.  struct catch_frame *next;};
  33.  
  34. struct gc_protected
  35. {LISP *location;
  36.  long length;
  37.  struct gc_protected *next;};
  38.  
  39. #define NEWCELL(_into,_type)          \
  40. {if (gc_kind_copying == 1)            \
  41.    {if ((_into = heap) >= heap_end)   \
  42.       gc_fatal_error();               \
  43.     heap = _into+1;}                  \
  44.  else                                 \
  45.    {if NULLP(freelist)                \
  46.       gc_for_newcell();               \
  47.     _into = freelist;                 \
  48.     freelist = CDR(freelist);         \
  49.     ++gc_cells_allocated;}            \
  50.  (*_into).gc_mark = 0;                \
  51.  (*_into).type = (short) _type;}
  52.  
  53. #ifdef THINK_C
  54. extern int ipoll_counter;
  55. void full_interrupt_poll(int *counter);
  56. #define INTERRUPT_CHECK() if (--ipoll_counter < 0) full_interrupt_poll(&ipoll_counter)
  57. #else
  58. #define INTERRUPT_CHECK()
  59. #endif
  60.  
  61. extern char *stack_limit_ptr;
  62.  
  63. #define STACK_LIMIT(_ptr,_amt) (((char *)_ptr) - (_amt))
  64.  
  65. #define STACK_CHECK(_ptr) \
  66.   if (((char *) (_ptr)) < stack_limit_ptr) err_stack((char *) _ptr);
  67.  
  68. void err_stack(char *);
  69.  
  70. #if defined(VMS) && defined(VAX)
  71. #define SIG_restargs ,...
  72. #else
  73. #define SIG_restargs
  74. #endif
  75.  
  76. void handle_sigfpe(int sig SIG_restargs);
  77. void handle_sigint(int sig SIG_restargs);
  78. void err_ctrl_c(void);
  79. double myruntime(void);
  80. void fput_st(FILE *f,char *st);
  81. void put_st(char *st);
  82. void grepl_puts(char *,void (*)(char *));
  83. void gc_fatal_error(void);
  84. char *must_malloc(unsigned long size);
  85. LISP gen_intern(char *name,long copyp);
  86. void scan_registers(void);
  87. void init_storage_1(void);
  88. struct user_type_hooks *get_user_type_hooks(long type);
  89. LISP get_newspace(void);
  90. void scan_newspace(LISP newspace);
  91. void free_oldspace(LISP space,LISP end);
  92. void gc_stop_and_copy(void);
  93. void gc_for_newcell(void);
  94. void gc_mark_and_sweep(void);
  95. void gc_ms_stats_start(void);
  96. void gc_ms_stats_end(void);
  97. void gc_mark(LISP ptr);
  98. void mark_protected_registers(void);
  99. void mark_locations(LISP *start,LISP *end);
  100. void mark_locations_array(LISP *x,long n);
  101. void gc_sweep(void);
  102. LISP leval_args(LISP l,LISP env);
  103. LISP extend_env(LISP actuals,LISP formals,LISP env);
  104. LISP envlookup(LISP var,LISP env);
  105. LISP setvar(LISP var,LISP val,LISP env);
  106. LISP leval_setq(LISP args,LISP env);
  107. LISP syntax_define(LISP args);
  108. LISP leval_define(LISP args,LISP env);
  109. LISP leval_if(LISP *pform,LISP *penv);
  110. LISP leval_lambda(LISP args,LISP env);
  111. LISP leval_progn(LISP *pform,LISP *penv);
  112. LISP leval_or(LISP *pform,LISP *penv);
  113. LISP leval_and(LISP *pform,LISP *penv);
  114. LISP leval_catch_1(LISP forms,LISP env);
  115. LISP leval_catch(LISP args,LISP env);
  116. LISP lthrow(LISP tag,LISP value);
  117. LISP leval_let(LISP *pform,LISP *penv);
  118. LISP reverse(LISP l);
  119. LISP let_macro(LISP form);
  120. LISP leval_quote(LISP args,LISP env);
  121. LISP leval_tenv(LISP args,LISP env);
  122. int flush_ws(struct gen_readio *f,char *eoferr);
  123. int f_getc(FILE *f);
  124. void f_ungetc(int c, FILE *f);
  125. LISP readtl(struct gen_readio *f);
  126. LISP lreadr(struct gen_readio *f);
  127. LISP lreadparen(struct gen_readio *f);
  128. LISP arglchk(LISP x);
  129. void init_storage_a1(long type);
  130. void init_storage_a(void);
  131. LISP array_gc_relocate(LISP ptr);
  132. void array_gc_scan(LISP ptr);
  133. LISP array_gc_mark(LISP ptr);
  134. void array_gc_free(LISP ptr);
  135. void array_prin1(LISP ptr,FILE *f);
  136. long array_sxhaxh(LISP,long);
  137. LISP array_fast_print(LISP,LISP);
  138. LISP array_fast_read(int,LISP);
  139. LISP array_equal(LISP,LISP);
  140. long array_sxhash(LISP,long);
  141.  
  142. int rfs_getc(unsigned char **p);
  143. void rfs_ungetc(unsigned char c,unsigned char **p);
  144. void err1_aset1(LISP i);
  145. void err2_aset1(LISP v);
  146. LISP lreadstring(struct gen_readio *f);
  147.  
  148. void file_gc_free(LISP ptr);
  149. void file_prin1(LISP ptr,FILE *f);
  150. LISP fopen_c(char *name,char *how);
  151. LISP fopen_l(LISP name,LISP how);
  152. LISP fclose_l(LISP p);
  153. FILE *get_c_file(LISP p,FILE *deflt);
  154. LISP lgetc(LISP p);
  155. LISP lputc(LISP c,LISP p);
  156. LISP lputs(LISP str,LISP p);
  157.  
  158. LISP lftell(LISP file);
  159. LISP lfseek(LISP file,LISP offset,LISP direction);
  160. LISP lfread(LISP size,LISP file);
  161. LISP lfwrite(LISP string,LISP file);
  162.  
  163.  
  164. LISP leval_while(LISP args,LISP env);
  165.  
  166. void init_subrs_a(void);
  167. void init_subrs_1(void);
  168.  
  169. long href_index(LISP table,LISP key);
  170.  
  171. void put_long(long,FILE *);
  172. long get_long(FILE *);
  173.  
  174. long fast_print_table(LISP obj,LISP table);
  175.  
  176. LISP stack_limit(LISP,LISP);
  177.  
  178.  
  179. void err0(void);
  180. void pr(LISP);
  181. void prp(LISP *);
  182.  
  183. LISP closure_code(LISP exp);
  184. LISP closure_env(LISP exp);
  185. LISP lwhile(LISP form,LISP env);
  186. LISP llength(LISP obj);
  187. void gc_kind_check(void);
  188. LISP allocate_aheap(void);
  189. long looks_pointerp(LISP);
  190. long nactive_heaps(void);
  191. long freelist_length(void);
  192. LISP gc_info(LISP);
  193.